home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Development Platforms / Apple II / Essentials / APW Interfaces / AInclude / M16.Util2 < prev    next >
Encoding:
Text File  |  1991-10-28  |  20.9 KB  |  816 lines  |  [TEXT/MPS ]

  1. ***********************************************************************
  2. *                                                                      *
  3. *                    Apple //GS Utility Macros                         *
  4. *                              by                                      *
  5. *                          Lou Infeld                                  *
  6. *                                                                      *
  7. *                Copyright Apple Computer, Inc. 1986, 1987             *
  8. *                       All Rights Reserved                            *
  9. *                                                                      *
  10. *        Revision History                                              *
  11. *        ----------------                                              *
  12. *        v1.0R1 (04/29/87) -- First Release                            *
  13. *                             This file is a subset of the old         *
  14. *                                "M16.Utility"                         *                  
  15. *    v2.0R1 (01/22/88) --    First AsmIIGS release                        *
  16. *    v2.0R2 (02/11/88) --    "writelin" renamed "writeline"                *
  17. *    v2.0R3 (03/29/88) --    "|" added to pea instrs to avoid Assembler    *
  18. *                                warning                                    *
  19. *                            "pushlong" was incorrect if &offset was "s"    *
  20. *                                or not specified                        *
  21. *    v2.0R4 (04/14/88) --    "writestr" and "writeline" didn't restore    *
  22. *                            STRING setting                                *
  23. *    v2.0R5 (08/22/88) --    "inc4" and "dec4" redefined to support only    *
  24. *                                positive 4 byte integers                *
  25. *                            "sub4" fixed so that there will not be any    *
  26. *                                truncation warnings generated            *
  27. *                            Pull macros now check for missing parameter *
  28. *                                  or extra parameter                        *
  29. *    v2.0R6 (09/06/88) --    "dec4" fixed to support positive 4 byte        *
  30. *                                integers                                *
  31. *   v2.0R7 (4/4/89) -- changed "long" to "longmx", "short" to "shortmx" *
  32. *                      and added stack based macros (rls3)              *
  33. *************************************************************************
  34.  
  35. ;............................................................
  36. ;
  37. ;        Pull long (4 bytes) from stack
  38. ;
  39. ;    pulllong address             - pull off stack to address
  40. ;    pulllong addr1,addr2         - pull off stack into 2 places
  41. ;    pulllong [zeropage],offset   - pull off stack and store indirectly             
  42. ;    pulllong                     - pull off stack and leave in A
  43. ;...............................................................
  44.          MACRO
  45. &lab     pulllong &addr1,&addr2
  46. &lab     ANOP
  47.          AIF   C:&addr1=0,.a
  48.          AIF   C:&addr2=0,.b
  49.          LCLC  &C
  50. &C       AMID  &addr1,1,1
  51.          AIF   "&C"="[",.zeropage
  52.          pullword  &addr1
  53.          sta   &addr2
  54.          pullword  &addr1+2
  55.          sta   &addr2+2
  56.          MEXIT
  57. .a
  58.          pullword
  59.          pullword
  60.          MEXIT
  61. .b
  62.          pullword  &addr1
  63.          pullword  &addr1+2
  64.          MEXIT
  65. .zeropage
  66.          ldy   #&addr2
  67.          pullword  &addr1,y
  68.          ldy   #&addr2+2
  69.          pullword  &addr1,y
  70.          MEND
  71. ;...............................................................
  72. ;
  73. ;        Pull 3 bytes from stack
  74. ;
  75. ;    pull3 addr    -- pulls bytes off stack and stores in "loc"
  76. ;...............................................................
  77.          MACRO
  78. &lab     pull3 &addr   
  79. &lab     ANOP
  80.          pull1 &addr
  81.          pullword  &addr+1
  82.          MEND
  83. ;...............................................................
  84. ;
  85. ;        Pull 2 bytes from stack
  86. ;
  87. ;    pullword loc     -- pulls bytes off stack and stores in "loc"
  88. ;    pullword loc,x   -- pulls bytes off stack and stores in "loc,x"
  89. ;    pullword         -- pulls bytes off stack and leaves in A
  90. ;...............................................................
  91.          MACRO
  92. &lab     pullword &SYSOPR
  93. &lab     ANOP
  94.          pla
  95.          AIF   C:&SYSOPR=0,.end
  96.          sta   &SYSOPR
  97. .end
  98.          MEND
  99. ;...............................................................
  100. ;
  101. ;        Pull 1 byte from stack
  102. ;
  103. ;    pull1 loc     -- pulls byte off stack and stores in "loc"
  104. ;    pull1 loc,x   -- pulls byte off stack and stores in "loc,x"
  105. ;    pull1         -- pulls byte off stack and leaves in A
  106. ;...............................................................
  107.          MACRO
  108. &lab     pull1 &SYSOPR
  109. &lab     ANOP
  110.          shortm
  111.          pla
  112.          AIF   C:&SYSOPR=0,.end
  113.          sta   &SYSOPR
  114. .end
  115.          longm
  116.          MEND
  117. ;...............................................................
  118. ;
  119. ;        Push 1 byte onto stack
  120. ;
  121. ;    push1 loc     -- pushes byte onto stack from "loc"
  122. ;    push1 loc,x   -- pushes byte onto stack from "loc,x"
  123. ;    push1 #n      -- pushes constant #n onto stack
  124. ;    push1         -- pushes byte onto stack (from A)
  125. ;...............................................................
  126.          MACRO
  127. &lab     push1 &SYSOPR
  128. &lab     ANOP
  129.          shortm
  130.          AIF   C:&SYSOPR=0,.a
  131.          pushword  &SYSOPR
  132.          AGO   .b
  133. .a
  134.          pushword
  135. .b
  136.          longm
  137.          MEND
  138. ;............................................................
  139. ;
  140. ;        Push long (4 bytes) onto stack
  141. ;
  142. ;    pushlong address             - push contents of address
  143. ;    pushlong address,x           - push contents of address,x
  144. ;    pushlong const,s             - push contents of stack+const    
  145. ;    pushlong #address/const      - push address or constant
  146. ;    pushlong [zeropage],offset   - push using indirect address
  147. ;...............................................................
  148.          MACRO
  149. &lab     pushlong &addr,&offset
  150. &lab     ANOP
  151.          LCLC  &C
  152.          LCLC  &REST
  153. &C       AMID  &addr,1,1
  154.          AIF   "&C"="#",.immediate
  155.          AIF   "&C"="[",.zeropage
  156.          AIF   C:&offset=0,.nooffset
  157.          AIF   "&offset"="s",.stack
  158.          pushword &addr+2,&offset
  159.          pushword &addr,&offset
  160.          MEXIT
  161. .nooffset
  162.          pushword  &addr+2
  163.          pushword  &addr
  164.          MEXIT
  165. .immediate
  166. &REST    AMID  &addr,2,L:&addr-1
  167.          dc    I1'$F4',I2'(&REST)|-16'
  168.          dc    I1'$F4',I2'&REST'
  169.          MEXIT
  170. .stack
  171.          pushword &addr+2,s
  172.          pushword &addr+2,s
  173.          MEXIT
  174. .zeropage
  175.          ldy   #&offset+2
  176.          pushword  &addr,y
  177.          ldy   #&offset
  178.          pushword  &addr,y
  179.          MEND
  180. ;...............................................................
  181. ;
  182. ;        Push 3 bytes onto stack
  183. ;
  184. ;    push3 addr    -- pushes bytes onto stack from "loc"
  185. ;    push3 addr,x  -- pushes bytes onto stack from "loc,x"
  186. ;    push3 #n      -- pushes constant #n onto stack
  187. ;...............................................................
  188.          MACRO
  189. &lab     push3 &addr,®
  190. &lab     ANOP
  191.          LCLC  &C
  192.          LCLC  &REST
  193. &C       AMID  &addr,1,1
  194. &REST    AMID  &addr,2,L:&addr
  195.          AIF   C:®>0,.indexed
  196.          AIF   "&C"="#",.immediate
  197.          lda   &addr+1
  198.          pha
  199.          AGO   .a
  200. .immediate
  201.          lda   #(&REST)|-8
  202.          pha
  203. .a
  204.          phb
  205.          lda   &addr
  206.          sta   1,s
  207.          MEXIT
  208. .indexed
  209.          lda   &addr+1,®
  210.          pha
  211.          phb
  212.          lda   &addr,®
  213.          sta   1,s
  214.          MEND
  215. ;...............................................................
  216. ;
  217. ;        Push 2 bytes onto stack
  218. ;
  219. ;    pushword loc     -- pushes bytes onto stack from "loc"
  220. ;    pushword loc,x   -- pushes bytes onto stack from "loc,x"
  221. ;    pushword #n      -- pushes constant #n onto stack
  222. ;    pushword         -- pushes bytes onto stack (from A)
  223. ;...............................................................
  224.          MACRO
  225. &lab     pushword  &SYSOPR
  226. &lab     ANOP
  227.          AIF   C:&SYSOPR=0,.b
  228.          LCLC  &C
  229. &C       AMID  "&SYSOPR",1,1
  230.          AIF   ("&C"="#").AND.(S:LONGA),.immediate
  231.          lda   &SYSOPR
  232.          pha
  233.          MEXIT
  234. .b
  235.          pha
  236.          MEXIT
  237. .immediate
  238.          LCLC  &REST
  239.          LCLA  &BL
  240. &BL      ASEARCH "&SYSOPR"," ",1
  241.          AIF   &BL>0,.a
  242. &BL      SETA  L:&SYSOPR+1
  243. .a
  244. &REST    AMID  "&SYSOPR",2,&BL-2
  245.          dc    I1'$F4',I2'&REST'
  246.          MEND
  247. ;...............................................................
  248. ;
  249. ;        Add 2 byte integers
  250. ;
  251. ;    add loc1,loc2,loc3 - adds "loc1" to "loc2" and stores in "loc3"
  252. ;    add loc1,loc2      - adds "loc1" to "loc2" and leaves in A
  253. ;    add ,loc2,loc3     - adds A with "loc2" and stores in "loc3" 
  254. ;
  255. ;        "loc1" and "loc2" can be constants
  256. ;...............................................................
  257.          MACRO
  258. &lab     add   &a1,&a2,&a3
  259. &lab     ANOP
  260.          AIF   C:&a1=0,.a
  261.          lda   &a1
  262. .a
  263.          clc
  264.          adc   &a2
  265.          AIF   C:&a3=0,.b
  266.          sta   &a3
  267. .b
  268.          MEND
  269. ;...............................................................
  270. ;
  271. ;        Add 4 byte integers
  272. ;
  273. ;    add4 loc1,loc2,loc3 - adds "loc1" to "loc2" and stores in "loc3"
  274. ;    add4 ,loc2,loc3     - adds A to "loc2" and stores in "loc3"
  275. ;
  276. ;        "loc1" and "loc2" can be constants
  277. ;...............................................................
  278.          MACRO
  279. &lab     add4  &a1,&a2,&a3
  280. &lab     ANOP
  281.          LCLC  &C1
  282.          LCLC  &C2
  283.          LCLC  &REST1
  284.          LCLC  &REST2
  285. &C2      AMID  &a2,1,1
  286. &REST2   AMID  &a2,2,L:&a2-1
  287.          AIF   C:&a1=0,.a
  288. &C1      AMID  &a1,1,1
  289. &REST1   AMID  &a1,2,L:&a1-1
  290.          lda   &a1
  291. .a
  292.          clc
  293.          adc   &a2
  294.          sta   &a3
  295.          AIF   C:&a1>0,.b
  296.          lda   #0
  297.          AGO   .d
  298. .b
  299.          AIF   "&C1"="#",.c
  300.          lda   &a1+2
  301.          AGO   .d
  302. .c
  303.          lda   #^&REST1
  304. .d
  305.          AIF   "&C2"="#",.e
  306.          adc   &a2+2
  307.          AGO   .f
  308. .e
  309.          adc   #^&REST2
  310. .f
  311.          sta   &a3+2
  312.          MEND
  313. ;...............................................................
  314. ;
  315. ;        Increment a positive 4 byte integer
  316. ;
  317. ;    inc4 loc - increments "loc"
  318. ;...............................................................
  319.          MACRO
  320. &lab     inc4  &a1
  321. &lab     ANOP
  322.          inc   &a1
  323.          bne   ~a&SYSCNT
  324.          inc   &a1+2
  325. ~a&SYSCNT ANOP
  326.          MEND
  327. ;...............................................................
  328. ;
  329. ;        Subtract 2 byte integers
  330. ;
  331. ;    sub loc1,loc2,loc3 - subtracts "loc2" from "loc1" and stores in "loc3"
  332. ;    sub loc1,loc2      - subtracts "loc2" from "loc1" and leaves in A
  333. ;    sub ,loc2,lo3      - subtracts "loc2" from A and stores in "loc3" 
  334. ;
  335. ;        "loc1" and "loc2" can be constants
  336. ;...............................................................
  337.          MACRO
  338. &lab     sub   &a1,&a2,&a3
  339. &lab     ANOP
  340.          AIF   C:&a1=0,.a
  341.          lda   &a1
  342. .a
  343.          sec
  344.          sbc   &a2
  345.          AIF   C:&a3=0,.b
  346.          sta   &a3
  347. .b
  348.          MEND
  349. ;...............................................................
  350. ;
  351. ;        Subtract 4 byte integers
  352. ;
  353. ;    sub4 loc1,loc2,loc3 - subtracts "loc2" from "loc1" and stores in "loc3"
  354. ;    sub4 ,loc2,loc3     - subtracts "loc2" from A and stores in "loc3"
  355. ;...............................................................
  356.          MACRO
  357. &lab     sub4  &a1,&a2,&a3
  358. &lab     ANOP
  359.          LCLC  &C1
  360.          LCLC  &C2
  361.          LCLC  &REST1
  362.          LCLC  &REST2
  363. &C2      AMID  &a2,1,1
  364. &REST2   AMID  &a2,2,L:&a2-1
  365.          AIF   C:&a1=0,.a
  366. &C1      AMID  &a1,1,1
  367. &REST1   AMID  &a1,2,L:&a1-1
  368.          lda   &a1
  369. .a
  370.          sec
  371.          sbc   &a2
  372.          sta   &a3
  373.          AIF   C:&a1>0,.b
  374.          lda   #0
  375.          AGO   .d
  376. .b
  377.          AIF   "&C1"="#",.c
  378.          lda   &a1+2
  379.          AGO   .d
  380. .c
  381.          lda   #^&REST1
  382. .d
  383.          AIF   "&C2"="#",.e
  384.          sbc   &a2+2
  385.          AGO   .f
  386. .e
  387.          sbc   #^&REST2
  388. .f
  389.          sta   &a3+2
  390.          MEND
  391. ;...............................................................
  392. ;
  393. ;        Decrement a positive 4 byte integer
  394. ;
  395. ;    dec4 loc - decrements "loc"
  396. ;...............................................................
  397.          MACRO
  398. &lab     dec4  &a1
  399. &lab     ANOP
  400.          pha
  401.          sec
  402.          lda   &a1
  403.          sbc   #1
  404.          bcs   ~a&SYSCNT
  405.          dec   &a1+2
  406. ~a&SYSCNT sta   &a1
  407.          pla
  408.          MEND
  409. ;...............................................................
  410. ;
  411. ;        Define string
  412. ;
  413. ;        Generates a Pascal type of string
  414. ;...............................................................
  415.          MACRO
  416. &lab     str   &string
  417. &lab     dc    i1'L:&string',C'&string'
  418.          MEND
  419. ;...............................................................
  420. ;
  421. ;        Define pointer
  422. ;...............................................................
  423.          MACRO
  424. &lab     dp    &pointer
  425. &lab     dc    i4'&pointer'
  426.          MEND
  427. ;...............................................................
  428. ;
  429. ;        Left Shift 4 bytes
  430. ;
  431. ;        asl4  loc,#n                   ;n is shift count (pos)
  432. ;        asl4  loc,lnum                 ;lnum contains shift count (pos)
  433. ;        asl4  loc                      ;X contains shift count (pos)
  434. ;...............................................................
  435.          MACRO
  436. &lab     asl4  &loc,&num
  437. &lab     ANOP
  438.          lda   &loc+2
  439.          AIF   C:&num=0,.a
  440.          ldx   &num
  441. .a
  442. ~a&SYSCNT asl  a
  443.          asl   &loc
  444.          adc   #0
  445.          dex
  446.          bne   ~a&SYSCNT
  447.          sta   &loc+2
  448.          MEND
  449. ;...............................................................
  450. ;
  451. ;        Right Shift 4 bytes
  452. ;
  453. ;        lsr4  loc,#n                   ;n is shift count (pos)
  454. ;        lsr4  loc,lnum                 ;lnum contains shift count (pos)
  455. ;        lsr4  loc                      ;X contains shift count (neg)
  456. ;...............................................................
  457.          MACRO
  458. &lab     lsr4  &loc,&num
  459. &lab     ANOP
  460.          AIF   C:&num=0,.a
  461.          lda   &num
  462.          eor   #$FFFF
  463.          clc
  464.          adc   #1
  465.          tax
  466. .a
  467.          lda   &loc
  468. ~a&SYSCNT lsr  a
  469.          lsr   &loc+2
  470.          bcc   ~b&SYSCNT
  471.          ora   #$8000
  472. ~b&SYSCNT inx
  473.          bne   ~a&SYSCNT
  474.          sta   &loc
  475.          MEND
  476. ;...............................................................
  477. ;
  478. ;        Turn on native mode
  479. ;
  480. ;    The processor is put into "native" mode.  8 bit or 16 bit
  481. ;    mode can be specified by using "shortmx" or "longmx" as the
  482. ;    parameter.  If no parameter is specified, "long" is assumed
  483. ;...............................................................
  484.          MACRO
  485. &lab     native &mode
  486. &lab     ANOP
  487.          clc
  488.          xce
  489.          AIF C:&mode=0,.a
  490.          &mode
  491.          MEXIT
  492. .a
  493.          longmx
  494.          MEND
  495. ;...............................................................
  496. ;
  497. ;        Turn on emulation mode
  498. ;
  499. ;    The processor is put into "emulation" mode.
  500. ;...............................................................
  501.          MACRO
  502. &lab     emulation
  503. &lab     ANOP
  504.          sec
  505.          xce
  506.          longa off
  507.          longi off
  508.          MEND
  509. ;...............................................................
  510. ;
  511. ;        Set Memory & registers to 16 bits
  512. ;...............................................................
  513.          MACRO
  514. &lab     longmx
  515. &lab     ANOP
  516.          rep   #%00110000
  517.          longa on
  518.          longi on
  519.          MEND
  520. ;...............................................................
  521. ;
  522. ;        Set Memory & A register to 16 bits
  523. ;...............................................................
  524.          MACRO
  525. &lab     longm
  526. &lab     ANOP
  527.          rep   #%00100000
  528.          longa on
  529.          MEND
  530. ;...............................................................
  531. ;
  532. ;        Set X & Y registers to 16 bits
  533. ;...............................................................
  534.          MACRO
  535. &lab     longx
  536. &lab     ANOP
  537.          rep   #%00010000
  538.          longi on
  539.          MEND
  540. ;...............................................................
  541. ;
  542. ;        Set Memory & registers to 8 bits
  543. ;...............................................................
  544.          MACRO
  545. &lab     shortmx
  546. &lab     ANOP
  547.          sep   #%00110000
  548.          longa off
  549.          longi off
  550.          MEND
  551. ;...............................................................
  552. ;
  553. ;        Set Memory & A register to 8 bits
  554. ;...............................................................
  555.          MACRO
  556. &lab     shortm
  557. &lab     ANOP
  558.          sep   #%00100000
  559.          longa off
  560.          MEND
  561. ;...............................................................
  562. ;
  563. ;        Set X & Y registers to 8 bits
  564. ;...............................................................
  565.          MACRO
  566. &lab     shortx
  567. &lab     ANOP
  568.          sep   #%00010000
  569.          longi off
  570.          MEND
  571. ;...............................................................
  572. ;
  573. ;        Write string
  574. ;
  575. ;        writestr loc     - string at loc "loc"
  576. ;        writestr #'ABC'  - string='ABC'
  577. ;        writestr         - A,Y has loc of string         
  578. ;...............................................................
  579.  
  580.          MACRO
  581. &lab     writestr &addr
  582. &lab     ANOP
  583.          AIF   C:&addr=0,.c
  584.          lclc  &char
  585. &char    amid  &addr,1,1
  586.          AIF   "&char"="#",.a
  587.          pea   &addr|-16
  588.          pea   &addr
  589.          ago   .b
  590. .a
  591.          lclc  &str
  592. &str     amid  &addr,3,L:&addr-3
  593.          bra   ~b&SYSCNT
  594. ~a&SYSCNT dc   i1'L:&str',C'&str'
  595. ~b&SYSCNT pea  ~a&SYSCNT|-16
  596.          pea   ~a&SYSCNT
  597. .b
  598.          ldx   #$1C0C
  599.          jsl   $E10000
  600.          MEXIT
  601. .c
  602.          phy
  603.          pha
  604.          AGO   .b
  605.          MEND
  606. ;...............................................................
  607. ;
  608. ;        Write line (string+CR)
  609. ;
  610. ;        writeln loc     - string at loc "loc"
  611. ;        writeln #'ABC'  - string='ABC'
  612. ;        writeln         - CR only
  613. ;
  614. ;...............................................................
  615.  
  616.          MACRO
  617. &lab     writeln &addr
  618. &lab     ANOP
  619.          AIF   C:&addr=0,.c
  620.          lclc  &char
  621. &char    amid  &addr,1,1
  622.          AIF   "&char"="#",.a
  623.          pea   &addr|-16
  624.          pea   &addr
  625.          ago   .b
  626. .a
  627.          lclc  &str
  628. &str     amid  &addr,3,L:&addr-3
  629.          bra   ~b&SYSCNT
  630. ~a&SYSCNT dc   I1'L:&str',C'&str'
  631. ~b&SYSCNT pea  ~a&SYSCNT|-16
  632.          pea   ~a&SYSCNT
  633. .b
  634.          ldx   #$1A0C
  635. ~c&SYSCNT jsl  $E10000
  636.          MEXIT
  637. .c
  638.          pea   +(~c&SYSCNT+1)|-16
  639.          pea   ~c&SYSCNT+1
  640.          AGO   .b
  641.          MEND
  642. ;...............................................................
  643. ;
  644. ;        Write character
  645. ;
  646. ;        writech          - char in A register
  647. ;        writech #'A'     - char='A'
  648. ;        writech ch,x     - char in loc "ch,x"
  649. ;...............................................................
  650.  
  651.          MACRO
  652. &lab     writech &SYSOPR
  653. &lab     ANOP
  654.          AIF   C:&SYSOPR=0,.a
  655.          lda   &SYSOPR
  656. .a
  657.          pha
  658.          ldx   #$180C
  659.          jsl   $E10000
  660.          MEND
  661. ;...............................................................
  662. ;
  663. ;              Read a char from keyboard
  664. ;
  665. ;        readch addr     - char stored in "addr"
  666. ;        readch          - char left in A register
  667. ;
  668. ;...............................................................
  669.  
  670.          MACRO
  671. &lab     readch &SYSOPR
  672. &lab     ANOP
  673.          pea   0
  674.          pea   1
  675.          ldx   #$220C
  676.          jsl   $E10000
  677.          pla
  678.          AIF   C:&SYSOPR=0,.a
  679.          sta   &SYSOPR
  680. .a
  681.          MEND
  682.  
  683. ;
  684. ; DSect &Value
  685. ;
  686. ; Begin local data section.  This defines a dummy PC
  687. ; register which can be used in equates to avoid error-
  688. ; prone linked equates for setting up direct page or
  689. ; stack offsets.  The dummy PC begins at &Value and
  690. ; is updated by the appropriate amount by the BYTE,
  691. ; WORD, LONG, and BLOCK macros.
  692. ;
  693.  MACRO
  694.  DSect &Value
  695.  GBLA &DummyPC
  696. &DummyPC SETA &Value
  697.  MEND
  698.  
  699.  
  700. ;
  701. ; DefineStack
  702. ;
  703. ; This is a specialized data section which defines
  704. ; a dummy PC starting at 1 in order to define a
  705. ; series of stack offsets using the BYTE, WORD,
  706. ; LONG, and BLOCK macros.
  707. ;
  708.  MACRO
  709.  DefineStack
  710.  GBLA &DummyPC
  711. &DummyPC SETA 1
  712.  MEND
  713.  
  714. ;
  715. ; &lab byte
  716. ;
  717. ; Equate the given label with the current dummy
  718. ; PC (defined by DSect, GlobalDSect, or
  719. ; DefineStack), and update the dummy PC by the
  720. ; appropriate amount.
  721. ;
  722.  MACRO
  723. &lab BYTE
  724. &lab equ &DummyPC
  725. &DummyPC SETA &DummyPC+1
  726.  MEND
  727.  
  728. ;
  729. ; &lab word
  730. ;
  731. ; Equate the given label with the current dummy
  732. ; PC (defined by DSect, GlobalDSect, or
  733. ; DefineStack), and update the dummy PC by the
  734. ; appropriate amount.
  735. ;
  736.  MACRO
  737. &lab WORD
  738. &lab equ &DummyPC
  739. &DummyPC SETA &DummyPC+2
  740.  MEXIT
  741.  MEND
  742.  
  743. ;
  744. ; &lab long
  745. ;
  746. ; Equate the given label with the current dummy
  747. ; PC (defined by DSect, GlobalDSect, or
  748. ; DefineStack), and update the dummy PC by the
  749. ; appropriate amount.
  750. ;
  751.  MACRO
  752. &lab LONG
  753. &lab equ &DummyPC
  754. &DummyPC SETA &DummyPC+4
  755.  MEND
  756.  
  757. ;
  758. ; &lab block &size
  759. ;
  760. ; Equate the given label with the current dummy
  761. ; PC (defined by DSect, GlobalDSect, or
  762. ; DefineStack), and update the dummy PC by the
  763. ; appropriate amount (&size bytes).
  764. ;
  765.  MACRO
  766. &lab BLOCK &Value
  767.  AIF C:&lab=0,.skiplab
  768. &lab equ &DummyPC
  769. .skiplab
  770. &DummyPC SETA &DummyPC+&Value
  771.  MEND
  772.  
  773. ;
  774. ; &lab DSectSize
  775. ;
  776. ; This macro equates the given label with the
  777. ; current dummy PC defined by the DSect,
  778. ; GlobalDSect, or DefineStack macros.  This is
  779. ; useful for determing the size of data sections
  780. ; or parts of data sections.
  781. ;
  782.  MACRO
  783. &lab DSectSize
  784. &lab equ &DummyPC
  785.  MEND
  786.  
  787. ;
  788. ; &lab EndLocals
  789. ;
  790. ; This macro equates the given label with the
  791. ; current DummyPC-1 defined by the DSect,
  792. ; GlobalDSect, or DefineStack macros.  This is
  793. ; useful for determing the stack usage of locals.
  794. ;
  795.  MACRO
  796. &lab EndLocals
  797. &lab equ &DummyPC-1
  798.  MEND
  799.  
  800. ;
  801. ; BegParms - description to be supplied at a future date.
  802. ;
  803.  MACRO
  804.  BegParms
  805. &BegParmsPC SETA &DummyPC
  806.  MEND
  807.  
  808. ;
  809. ; EndParms - description to be supplied at a future date.
  810. ;
  811.  MACRO
  812. &lab EndParms
  813. &lab equ &DummyPC-&BegParmsPC
  814.  MEND
  815.  
  816.